Integrand size = 20, antiderivative size = 224 \[ \int (e+f x)^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx=a e^2 x+a e f x^2+\frac {1}{3} a f^2 x^3+b d e f x \cos \left (c+\frac {d}{x}\right )+\frac {1}{6} b d f^2 x^2 \cos \left (c+\frac {d}{x}\right )-b d e^2 \cos (c) \operatorname {CosIntegral}\left (\frac {d}{x}\right )+\frac {1}{6} b d^3 f^2 \cos (c) \operatorname {CosIntegral}\left (\frac {d}{x}\right )+b d^2 e f \operatorname {CosIntegral}\left (\frac {d}{x}\right ) \sin (c)+b e^2 x \sin \left (c+\frac {d}{x}\right )-\frac {1}{6} b d^2 f^2 x \sin \left (c+\frac {d}{x}\right )+b e f x^2 \sin \left (c+\frac {d}{x}\right )+\frac {1}{3} b f^2 x^3 \sin \left (c+\frac {d}{x}\right )+b d^2 e f \cos (c) \text {Si}\left (\frac {d}{x}\right )+b d e^2 \sin (c) \text {Si}\left (\frac {d}{x}\right )-\frac {1}{6} b d^3 f^2 \sin (c) \text {Si}\left (\frac {d}{x}\right ) \]
a*e^2*x+a*e*f*x^2+1/3*a*f^2*x^3-b*d*e^2*Ci(d/x)*cos(c)+1/6*b*d^3*f^2*Ci(d/ x)*cos(c)+b*d*e*f*x*cos(c+d/x)+1/6*b*d*f^2*x^2*cos(c+d/x)+b*d^2*e*f*cos(c) *Si(d/x)+b*d^2*e*f*Ci(d/x)*sin(c)+b*d*e^2*Si(d/x)*sin(c)-1/6*b*d^3*f^2*Si( d/x)*sin(c)+b*e^2*x*sin(c+d/x)-1/6*b*d^2*f^2*x*sin(c+d/x)+b*e*f*x^2*sin(c+ d/x)+1/3*b*f^2*x^3*sin(c+d/x)
Time = 0.42 (sec) , antiderivative size = 150, normalized size of antiderivative = 0.67 \[ \int (e+f x)^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx=\frac {1}{6} \left (b d \operatorname {CosIntegral}\left (\frac {d}{x}\right ) \left (\left (-6 e^2+d^2 f^2\right ) \cos (c)+6 d e f \sin (c)\right )+x \left (2 a \left (3 e^2+3 e f x+f^2 x^2\right )+b d f (6 e+f x) \cos \left (c+\frac {d}{x}\right )+b \left (6 e^2+6 e f x-f^2 \left (d^2-2 x^2\right )\right ) \sin \left (c+\frac {d}{x}\right )\right )-b d \left (-6 d e f \cos (c)+\left (-6 e^2+d^2 f^2\right ) \sin (c)\right ) \text {Si}\left (\frac {d}{x}\right )\right ) \]
(b*d*CosIntegral[d/x]*((-6*e^2 + d^2*f^2)*Cos[c] + 6*d*e*f*Sin[c]) + x*(2* a*(3*e^2 + 3*e*f*x + f^2*x^2) + b*d*f*(6*e + f*x)*Cos[c + d/x] + b*(6*e^2 + 6*e*f*x - f^2*(d^2 - 2*x^2))*Sin[c + d/x]) - b*d*(-6*d*e*f*Cos[c] + (-6* e^2 + d^2*f^2)*Sin[c])*SinIntegral[d/x])/6
Time = 0.62 (sec) , antiderivative size = 224, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3912, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (e+f x)^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx\) |
\(\Big \downarrow \) 3912 |
\(\displaystyle -\int \left (f^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) x^4+2 e f \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) x^3+e^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) x^2\right )d\frac {1}{x}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle a e^2 x+a e f x^2+\frac {1}{3} a f^2 x^3+\frac {1}{6} b d^3 f^2 \cos (c) \operatorname {CosIntegral}\left (\frac {d}{x}\right )+b d^2 e f \sin (c) \operatorname {CosIntegral}\left (\frac {d}{x}\right )-b d e^2 \cos (c) \operatorname {CosIntegral}\left (\frac {d}{x}\right )-\frac {1}{6} b d^3 f^2 \sin (c) \text {Si}\left (\frac {d}{x}\right )+b d^2 e f \cos (c) \text {Si}\left (\frac {d}{x}\right )-\frac {1}{6} b d^2 f^2 x \sin \left (c+\frac {d}{x}\right )+b d e^2 \sin (c) \text {Si}\left (\frac {d}{x}\right )+b e^2 x \sin \left (c+\frac {d}{x}\right )+b e f x^2 \sin \left (c+\frac {d}{x}\right )+b d e f x \cos \left (c+\frac {d}{x}\right )+\frac {1}{3} b f^2 x^3 \sin \left (c+\frac {d}{x}\right )+\frac {1}{6} b d f^2 x^2 \cos \left (c+\frac {d}{x}\right )\) |
a*e^2*x + a*e*f*x^2 + (a*f^2*x^3)/3 + b*d*e*f*x*Cos[c + d/x] + (b*d*f^2*x^ 2*Cos[c + d/x])/6 - b*d*e^2*Cos[c]*CosIntegral[d/x] + (b*d^3*f^2*Cos[c]*Co sIntegral[d/x])/6 + b*d^2*e*f*CosIntegral[d/x]*Sin[c] + b*e^2*x*Sin[c + d/ x] - (b*d^2*f^2*x*Sin[c + d/x])/6 + b*e*f*x^2*Sin[c + d/x] + (b*f^2*x^3*Si n[c + d/x])/3 + b*d^2*e*f*Cos[c]*SinIntegral[d/x] + b*d*e^2*Sin[c]*SinInte gral[d/x] - (b*d^3*f^2*Sin[c]*SinIntegral[d/x])/6
3.3.88.3.1 Defintions of rubi rules used
Int[((g_.) + (h_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*((e_.) + (f _.)*(x_))^(n_)])^(p_.), x_Symbol] :> Simp[1/(n*f) Subst[Int[ExpandIntegra nd[(a + b*Sin[c + d*x])^p, x^(1/n - 1)*(g - e*(h/f) + h*(x^(1/n)/f))^m, x], x], x, (e + f*x)^n], x] /; FreeQ[{a, b, c, d, e, f, g, h, m}, x] && IGtQ[p , 0] && IntegerQ[1/n]
Time = 0.56 (sec) , antiderivative size = 188, normalized size of antiderivative = 0.84
method | result | size |
parts | \(\frac {a \left (f x +e \right )^{3}}{3 f}-b d \left (e^{2} \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x}{d}-\operatorname {Si}\left (\frac {d}{x}\right ) \sin \left (c \right )+\operatorname {Ci}\left (\frac {d}{x}\right ) \cos \left (c \right )\right )+2 d e f \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x^{2}}{2 d^{2}}-\frac {\cos \left (c +\frac {d}{x}\right ) x}{2 d}-\frac {\operatorname {Si}\left (\frac {d}{x}\right ) \cos \left (c \right )}{2}-\frac {\operatorname {Ci}\left (\frac {d}{x}\right ) \sin \left (c \right )}{2}\right )+d^{2} f^{2} \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x^{3}}{3 d^{3}}-\frac {\cos \left (c +\frac {d}{x}\right ) x^{2}}{6 d^{2}}+\frac {\sin \left (c +\frac {d}{x}\right ) x}{6 d}+\frac {\operatorname {Si}\left (\frac {d}{x}\right ) \sin \left (c \right )}{6}-\frac {\operatorname {Ci}\left (\frac {d}{x}\right ) \cos \left (c \right )}{6}\right )\right )\) | \(188\) |
derivativedivides | \(-d \left (-\frac {a \,f^{2} x^{3}}{3 d}-\frac {a e f \,x^{2}}{d}-\frac {a \,e^{2} x}{d}+b \,d^{2} f^{2} \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x^{3}}{3 d^{3}}-\frac {\cos \left (c +\frac {d}{x}\right ) x^{2}}{6 d^{2}}+\frac {\sin \left (c +\frac {d}{x}\right ) x}{6 d}+\frac {\operatorname {Si}\left (\frac {d}{x}\right ) \sin \left (c \right )}{6}-\frac {\operatorname {Ci}\left (\frac {d}{x}\right ) \cos \left (c \right )}{6}\right )+2 b d e f \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x^{2}}{2 d^{2}}-\frac {\cos \left (c +\frac {d}{x}\right ) x}{2 d}-\frac {\operatorname {Si}\left (\frac {d}{x}\right ) \cos \left (c \right )}{2}-\frac {\operatorname {Ci}\left (\frac {d}{x}\right ) \sin \left (c \right )}{2}\right )+b \,e^{2} \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x}{d}-\operatorname {Si}\left (\frac {d}{x}\right ) \sin \left (c \right )+\operatorname {Ci}\left (\frac {d}{x}\right ) \cos \left (c \right )\right )\right )\) | \(209\) |
default | \(-d \left (-\frac {a \,f^{2} x^{3}}{3 d}-\frac {a e f \,x^{2}}{d}-\frac {a \,e^{2} x}{d}+b \,d^{2} f^{2} \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x^{3}}{3 d^{3}}-\frac {\cos \left (c +\frac {d}{x}\right ) x^{2}}{6 d^{2}}+\frac {\sin \left (c +\frac {d}{x}\right ) x}{6 d}+\frac {\operatorname {Si}\left (\frac {d}{x}\right ) \sin \left (c \right )}{6}-\frac {\operatorname {Ci}\left (\frac {d}{x}\right ) \cos \left (c \right )}{6}\right )+2 b d e f \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x^{2}}{2 d^{2}}-\frac {\cos \left (c +\frac {d}{x}\right ) x}{2 d}-\frac {\operatorname {Si}\left (\frac {d}{x}\right ) \cos \left (c \right )}{2}-\frac {\operatorname {Ci}\left (\frac {d}{x}\right ) \sin \left (c \right )}{2}\right )+b \,e^{2} \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x}{d}-\operatorname {Si}\left (\frac {d}{x}\right ) \sin \left (c \right )+\operatorname {Ci}\left (\frac {d}{x}\right ) \cos \left (c \right )\right )\right )\) | \(209\) |
risch | \(a \,e^{2} x +\frac {a \,f^{2} x^{3}}{3}+a e f \,x^{2}+\frac {b d \,e^{2} {\mathrm e}^{-i c} \operatorname {Ei}_{1}\left (\frac {i d}{x}\right )}{2}-\frac {b \,d^{3} f^{2} {\mathrm e}^{-i c} \operatorname {Ei}_{1}\left (\frac {i d}{x}\right )}{12}-\frac {i b \,d^{2} e f \,{\mathrm e}^{-i c} \operatorname {Ei}_{1}\left (\frac {i d}{x}\right )}{2}+\frac {b d \,e^{2} {\mathrm e}^{i c} \operatorname {Ei}_{1}\left (-\frac {i d}{x}\right )}{2}-\frac {b \,d^{3} f^{2} {\mathrm e}^{i c} \operatorname {Ei}_{1}\left (-\frac {i d}{x}\right )}{12}+\frac {i b \,d^{2} e f \,{\mathrm e}^{i c} \operatorname {Ei}_{1}\left (-\frac {i d}{x}\right )}{2}-\frac {x b f \left (-2 d x f -12 d e \right ) \cos \left (\frac {c x +d}{x}\right )}{12}+\frac {i x b \left (2 i d^{2} f^{2}-4 i x^{2} f^{2}-12 i e f x -12 i e^{2}\right ) \sin \left (\frac {c x +d}{x}\right )}{12}\) | \(229\) |
1/3*a*(f*x+e)^3/f-b*d*(e^2*(-sin(c+d/x)/d*x-Si(d/x)*sin(c)+Ci(d/x)*cos(c)) +2*d*e*f*(-1/2*sin(c+d/x)/d^2*x^2-1/2*cos(c+d/x)/d*x-1/2*Si(d/x)*cos(c)-1/ 2*Ci(d/x)*sin(c))+d^2*f^2*(-1/3*sin(c+d/x)/d^3*x^3-1/6*cos(c+d/x)/d^2*x^2+ 1/6*sin(c+d/x)/d*x+1/6*Si(d/x)*sin(c)-1/6*Ci(d/x)*cos(c)))
Time = 0.29 (sec) , antiderivative size = 185, normalized size of antiderivative = 0.83 \[ \int (e+f x)^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx=\frac {1}{3} \, a f^{2} x^{3} + a e f x^{2} + a e^{2} x + \frac {1}{6} \, {\left (6 \, b d^{2} e f \operatorname {Si}\left (\frac {d}{x}\right ) + {\left (b d^{3} f^{2} - 6 \, b d e^{2}\right )} \operatorname {Ci}\left (\frac {d}{x}\right )\right )} \cos \left (c\right ) + \frac {1}{6} \, {\left (b d f^{2} x^{2} + 6 \, b d e f x\right )} \cos \left (\frac {c x + d}{x}\right ) + \frac {1}{6} \, {\left (6 \, b d^{2} e f \operatorname {Ci}\left (\frac {d}{x}\right ) - {\left (b d^{3} f^{2} - 6 \, b d e^{2}\right )} \operatorname {Si}\left (\frac {d}{x}\right )\right )} \sin \left (c\right ) + \frac {1}{6} \, {\left (2 \, b f^{2} x^{3} + 6 \, b e f x^{2} - {\left (b d^{2} f^{2} - 6 \, b e^{2}\right )} x\right )} \sin \left (\frac {c x + d}{x}\right ) \]
1/3*a*f^2*x^3 + a*e*f*x^2 + a*e^2*x + 1/6*(6*b*d^2*e*f*sin_integral(d/x) + (b*d^3*f^2 - 6*b*d*e^2)*cos_integral(d/x))*cos(c) + 1/6*(b*d*f^2*x^2 + 6* b*d*e*f*x)*cos((c*x + d)/x) + 1/6*(6*b*d^2*e*f*cos_integral(d/x) - (b*d^3* f^2 - 6*b*d*e^2)*sin_integral(d/x))*sin(c) + 1/6*(2*b*f^2*x^3 + 6*b*e*f*x^ 2 - (b*d^2*f^2 - 6*b*e^2)*x)*sin((c*x + d)/x)
\[ \int (e+f x)^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx=\int \left (a + b \sin {\left (c + \frac {d}{x} \right )}\right ) \left (e + f x\right )^{2}\, dx \]
Result contains complex when optimal does not.
Time = 0.29 (sec) , antiderivative size = 258, normalized size of antiderivative = 1.15 \[ \int (e+f x)^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx=\frac {1}{3} \, a f^{2} x^{3} + a e f x^{2} - \frac {1}{2} \, {\left ({\left ({\left ({\rm Ei}\left (\frac {i \, d}{x}\right ) + {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \cos \left (c\right ) - {\left (-i \, {\rm Ei}\left (\frac {i \, d}{x}\right ) + i \, {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \sin \left (c\right )\right )} d - 2 \, x \sin \left (\frac {c x + d}{x}\right )\right )} b e^{2} + \frac {1}{2} \, {\left ({\left ({\left (-i \, {\rm Ei}\left (\frac {i \, d}{x}\right ) + i \, {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \cos \left (c\right ) + {\left ({\rm Ei}\left (\frac {i \, d}{x}\right ) + {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \sin \left (c\right )\right )} d^{2} + 2 \, d x \cos \left (\frac {c x + d}{x}\right ) + 2 \, x^{2} \sin \left (\frac {c x + d}{x}\right )\right )} b e f + \frac {1}{12} \, {\left ({\left ({\left ({\rm Ei}\left (\frac {i \, d}{x}\right ) + {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \cos \left (c\right ) + {\left (i \, {\rm Ei}\left (\frac {i \, d}{x}\right ) - i \, {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \sin \left (c\right )\right )} d^{3} + 2 \, d x^{2} \cos \left (\frac {c x + d}{x}\right ) - 2 \, {\left (d^{2} x - 2 \, x^{3}\right )} \sin \left (\frac {c x + d}{x}\right )\right )} b f^{2} + a e^{2} x \]
1/3*a*f^2*x^3 + a*e*f*x^2 - 1/2*(((Ei(I*d/x) + Ei(-I*d/x))*cos(c) - (-I*Ei (I*d/x) + I*Ei(-I*d/x))*sin(c))*d - 2*x*sin((c*x + d)/x))*b*e^2 + 1/2*(((- I*Ei(I*d/x) + I*Ei(-I*d/x))*cos(c) + (Ei(I*d/x) + Ei(-I*d/x))*sin(c))*d^2 + 2*d*x*cos((c*x + d)/x) + 2*x^2*sin((c*x + d)/x))*b*e*f + 1/12*(((Ei(I*d/ x) + Ei(-I*d/x))*cos(c) + (I*Ei(I*d/x) - I*Ei(-I*d/x))*sin(c))*d^3 + 2*d*x ^2*cos((c*x + d)/x) - 2*(d^2*x - 2*x^3)*sin((c*x + d)/x))*b*f^2 + a*e^2*x
Leaf count of result is larger than twice the leaf count of optimal. 1263 vs. \(2 (212) = 424\).
Time = 0.38 (sec) , antiderivative size = 1263, normalized size of antiderivative = 5.64 \[ \int (e+f x)^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx=\text {Too large to display} \]
1/6*(b*c^3*d^4*f^2*cos(c)*cos_integral(-c + (c*x + d)/x) + b*c^3*d^4*f^2*s in(c)*sin_integral(c - (c*x + d)/x) - 3*(c*x + d)*b*c^2*d^4*f^2*cos(c)*cos _integral(-c + (c*x + d)/x)/x + 6*b*c^3*d^3*e*f*cos_integral(-c + (c*x + d )/x)*sin(c) - 6*b*c^3*d^3*e*f*cos(c)*sin_integral(c - (c*x + d)/x) - 3*(c* x + d)*b*c^2*d^4*f^2*sin(c)*sin_integral(c - (c*x + d)/x)/x - 6*b*c^3*d^2* e^2*cos(c)*cos_integral(-c + (c*x + d)/x) + 3*(c*x + d)^2*b*c*d^4*f^2*cos( c)*cos_integral(-c + (c*x + d)/x)/x^2 - 18*(c*x + d)*b*c^2*d^3*e*f*cos_int egral(-c + (c*x + d)/x)*sin(c)/x + b*c^2*d^4*f^2*sin((c*x + d)/x) + 18*(c* x + d)*b*c^2*d^3*e*f*cos(c)*sin_integral(c - (c*x + d)/x)/x - 6*b*c^3*d^2* e^2*sin(c)*sin_integral(c - (c*x + d)/x) + 3*(c*x + d)^2*b*c*d^4*f^2*sin(c )*sin_integral(c - (c*x + d)/x)/x^2 - 6*b*c^2*d^3*e*f*cos((c*x + d)/x) + b *c*d^4*f^2*cos((c*x + d)/x) - (c*x + d)^3*b*d^4*f^2*cos(c)*cos_integral(-c + (c*x + d)/x)/x^3 + 18*(c*x + d)*b*c^2*d^2*e^2*cos(c)*cos_integral(-c + (c*x + d)/x)/x + 18*(c*x + d)^2*b*c*d^3*e*f*cos_integral(-c + (c*x + d)/x) *sin(c)/x^2 - 2*(c*x + d)*b*c*d^4*f^2*sin((c*x + d)/x)/x - 18*(c*x + d)^2* b*c*d^3*e*f*cos(c)*sin_integral(c - (c*x + d)/x)/x^2 - (c*x + d)^3*b*d^4*f ^2*sin(c)*sin_integral(c - (c*x + d)/x)/x^3 + 18*(c*x + d)*b*c^2*d^2*e^2*s in(c)*sin_integral(c - (c*x + d)/x)/x + 12*(c*x + d)*b*c*d^3*e*f*cos((c*x + d)/x)/x - (c*x + d)*b*d^4*f^2*cos((c*x + d)/x)/x - 18*(c*x + d)^2*b*c*d^ 2*e^2*cos(c)*cos_integral(-c + (c*x + d)/x)/x^2 - 6*(c*x + d)^3*b*d^3*e...
Timed out. \[ \int (e+f x)^2 \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx=\int {\left (e+f\,x\right )}^2\,\left (a+b\,\sin \left (c+\frac {d}{x}\right )\right ) \,d x \]